home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_074 / less / help.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  81 lines

  1. #include  "less.h"
  2.  
  3. /*
  4.  * Display some help.
  5.  * Help is in two pages.
  6.  */
  7.     static void
  8. help0()
  9. {
  10.     puts("f, SPACE       Forward one screen.\n");
  11.     puts("b,B            Backward one screen.\n");
  12.     puts("e, j, CR    *  Forward N lines, default 1.\n");
  13.     puts("y, k        *  Backward N lines, default 1.\n");
  14.     puts("d           *  Forward N lines, default 10 or last N to d or u command.\n");
  15.     puts("u           *  Backward N lines, default 10 or last N to d or u command.\n");
  16.     puts("r              Repaint screen.\n");
  17.     puts("g           *  Go to line N, default 1.\n");
  18.     puts("G           *  Like g, but default is last line in file.\n");
  19.     puts("=              Print current file name\n");
  20.     puts("/pattern    *  Search forward for N-th occurence of pattern.\n");
  21.     puts("?pattern    *  Search backward for N-th occurence of pattern.\n");
  22.     puts("n           *  Repeat previous search (for N-th occurence).\n");
  23.     puts("q,Q            Exit.\n");
  24.     error("More help...");
  25. }
  26.  
  27.     static void
  28. help1()
  29. {
  30.     char message[100];
  31.     extern char all_options[];
  32.  
  33.     puts("R              Repaint screen, discarding buffered input.\n");
  34.     puts("p, %        *  Position to N percent into the file.\n");
  35.     puts("m<letter>      Mark the current position with <letter>.\n");
  36.     puts("'<letter>      Return to a previously marked position.\n");
  37.     sprintf(message, 
  38.          "-X             Toggle a flag (X may be one of \"%s\").\n", 
  39.                 all_options);
  40.     puts(message);
  41.     puts("E [file]       Examine a new file.\n");
  42.     puts("N              Examine the next file (from the command line).\n");
  43.     puts("P              Examine the previous file (from the command line).\n");
  44.     puts("V              Print version number.\n");
  45. #if SHELL_ESCAPE
  46.     puts("!command       Passes the command to a shell to be executed.\n");
  47. #endif
  48. #if EDITOR
  49.     sprintf(message,
  50.          "v              Edit the current file with $EDITOR (default %s).\n",
  51.                 EDIT_PGM);
  52.     puts(message);
  53. #endif
  54.     error("");
  55. }
  56.  
  57.     public void
  58. help()
  59. {
  60.     register int i;
  61.  
  62.     for (i = 0;  i < 2;  i++)
  63.     {
  64.         clear();
  65.         so_enter();
  66.         puts("Amiga LESS 1.1 by\n");
  67.         puts("Bob Leivian      \n");
  68.          puts("2702 W. Curry St.\n");
  69.         puts("Chandler AZ 85224");
  70.         so_exit();
  71.         
  72.         puts("\n\nCommands marked with * may be preceeded by a number, N.\n\n");
  73.  
  74.         switch (i)
  75.         {
  76.         case 0:         help0();        break;
  77.         case 1:         help1();        break;
  78.         }
  79.     }
  80. }
  81.